//
// Created by root on 01/04/17.
//

#ifndef IMG_SVR_IMG_SVR_MAIN_H
#define IMG_SVR_IMG_SVR_MAIN_H

#include "Poco/Util/ServerApplication.h"
#include "http_svr.h"
#include "sys_config.h"
#include "temp_clean.h"
namespace img_svr {
    class ImgSvrMain :public Poco::Util::ServerApplication{
    public:
        static ImgSvrMain& instance();
        const SysConfig& GetConfig() const{
            return _sys_config;
        }
    protected:
        int main(const std::vector<std::string> &args);
    private:
        ImgSvrMain(){}
        int load_config();
        void init_log();
        int get_local_ip(string &ip,string default_ip);
        SysConfig _sys_config;
        Poco::SharedPtr<HttpSvr> _httpserver;
    };
}
#endif //IMG_SVR_IMG_SVR_MAIN_H
